Working with Nreal Devices

Nreal SDK Versions Supported by EasyAR

These Nreal SDK versions are already supported by EasyAR in this release: 1.5.7 - 1.8.0. A future Nreal SDK release may also be supported if its interfaces used by EasyAR did not change. For small changes in those interfaces, you can modify NrealFrameSource script before an update is released by EasyAR.

Nreal support is implemented as EasyAR Sense custom camera. Personal edition users can use EasyAR for 100 seconds per run when custom camera is chosen in runtime. There is no limitation when using a paid license for EasyAR Sense.

Import Nreal Unity Asset Package

If you are using samples from EasyAR, do not open sample Scene before Nreal Unity Asset Package imported, or some irregular situations may happen. Suggest to delete and reimport sample if you opened and saved the sample scene before package import.

Skip this step if you already have a usable Nreal project.

Get unitypackage file of Nreal SDK from Nreal, and use Unity > Assets > Import Package to import Nreal SDK.

Create Nreal Unity Package (Virtual)

Nreal SDK is not published as a Unity Package at the time of this version release. But EasyAR will use Unity Package to check and use dependencies.

Create com.nreal.sdk folder inside Packages folder of Unity project, and create package.json inside com.nreal.sdk with following contents. Please notice that the value of version should be same with Nreal SDK distribution you get.

{
    "name": "com.nreal.sdk",
    "displayName": "Nreal MR SDK for Unity",
    "version": "1.7.0",
    "unity": "2019.4",
    "description": "",
    "keywords": [],
    "dependencies": {}
}

Then file structure inside Unity project will be like this,

.
├── Assets
└── Packages
   └── com.nreal.sdk
       └── package.json

This virtual package is not needed if Nreal publish its SDK using Unity Package in future. If the package name is not equal to the value above at that time, all com.nreal.sdk strings from .asmdef files inside EasyAR package should be replaced with the official name.

Create a Scene Usable on Nreal

Skip this step if you already have a usable Nreal project.

Create a scene usable on Nreal according to Nreal documents or its demos. You can also use its demo directly. It is suggested to make sure the scene could be used normally before adding EasyAR components into the scene.

Add EasyAR Components in the Scene

Add EasyAR AR Session and other necessary nodes in the scene. You can reference Start from Zero for startups. AR Session can be created from some AR Session presets or constructed from standalone feature nodes using EasyAR Sense > GameObject menu. There are also some presets that could be used on Eyewears in menu EasyAR Sense > Eyewear.

../_images/image_g5_1.png

To use EasyAR on Nreal, NrealFrameSource must be selected as frame source in the AR Session after Session start.

This could usually be done by set ARComponentPicker.FrameSource to FirstAvailableActiveChild and make sure NrealFrameSource is the first frame source in transform order,

../_images/image_g5_2.png

Or set ARComponentPicker.FrameSource to Specify and specify the frame source to NrealFrameSource .

../_images/image_g5_3.png

NrealFrameSource can be added to AR Session from menu EasyAR Sense > HMD > Frame Source : Nreal if it does not exist in the session.

../_images/image_g5_4.png

Then add targets or maps in the scene, for example, if you want to build Sparse SpatialMap, you need to create SparseSpatialMapController by EasyAR Sense > SpatialMap > Map : Sparse SpatialMap

../_images/image_g1_18.png

Finally, a simple scene for sparse and dense spatial map building on Nreal could look like this,

../_images/image_g5_5.png

Scenes can be different according to features in use from both Nreal SDK and EasyAR Sense Unity Plugin.